﻿using Microsoft.AspNetCore.Razor.TagHelpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MvcSample.Infrastructure.TagHelpers
{
    //[HtmlTargetElement(Attributes ="bold")]
    //[HtmlTargetElement("bold")]
    [HtmlTargetElement("bold", Attributes = "bold")]
    public class BoldTagHelper
        :TagHelper
    {
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            //output.PreElement.SetHtmlContent("<p>PreElement</p>");
            //output.PreContent.SetHtmlContent("<p>PreContent</p>");
            //output.Content.SetHtmlContent("<p>Content</p>");
            //output.PostContent.SetHtmlContent("<p>PostContent</p>");
            //output.PostElement.SetHtmlContent("<p>PostElement</p>");
            output.Attributes.RemoveAll("bold");
            output.PreContent.SetHtmlContent("<strong>");
            output.PostContent.SetHtmlContent("</strong>");
        }
    }
}
